#include "stdafx.h"
#include "SDLGmud.h"

void SDLGmud::OnCleanup()
{
	//Remember to cleanup surf
	SDL_FreeSurface(Surf_Display);
	//SDL_FreeSurface(Surf_Test);
	//Cleanup a little bit to make sure everything works smoothly
	//Where you would free other surfaces as well

	for(int i = 0; i < GEntity::EntityList.size(); i++)
	{
		if(!GEntity::EntityList[i])
			continue;

		GEntity::EntityList[i]->OnCleanup();
	}

	GEntity::EntityList.clear();

	GArea::AreaControl.OnCleanup();

	SDL_Quit();
}